package com.exchange.Public;

import android.content.Context;
import java.lang.reflect.Field;

public class a
{
  private static a a;
  private static Class c = null;
  private static Class d = null;
  private static Class e = null;
  private static Class f = null;
  private static Class g = null;
  private static Class h = null;
  private Context b;

  private a(Context paramContext)
  {
    this.b = paramContext;
    try
    {
      d = Class.forName(this.b.getPackageName() + ".R$drawable");
      e = Class.forName(this.b.getPackageName() + ".R$layout");
      c = Class.forName(this.b.getPackageName() + ".R$id");
      f = Class.forName(this.b.getPackageName() + ".R$anim");
      g = Class.forName(this.b.getPackageName() + ".R$style");
      h = Class.forName(this.b.getPackageName() + ".R$string");
      if (ExchangeConstants.sample_appIcon == null)
      {
        int[] arrayOfInt = new int[8];
        arrayOfInt[0] = c("exchange_zhanwei");
        arrayOfInt[1] = c("exchange_zhanwei");
        arrayOfInt[2] = c("exchange_zhanwei");
        arrayOfInt[3] = c("exchange_zhanwei");
        arrayOfInt[4] = c("exchange_zhanwei");
        arrayOfInt[5] = c("exchange_zhanwei");
        arrayOfInt[6] = c("exchange_zhanwei");
        arrayOfInt[7] = c("exchange_zhanwei");
        ExchangeConstants.sample_appIcon = arrayOfInt;
      }
      return;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      localClassNotFoundException.printStackTrace();
    }
  }

  private int a(Class<?> paramClass, String paramString)
  {
    int i;
    if (paramClass == null)
      throw new IllegalArgumentException("ResClass is not initialized.");
    try
    {
      int j = paramClass.getField(paramString).getInt(paramString);
      i = j;
      return i;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      n.d("exchange", localException.getMessage());
      i = -1;
    }
  }

  public static a a(Context paramContext)
  {
    if (a == null)
      a = new a(paramContext);
    return a;
  }

  public int a(String paramString)
  {
    return a(f, paramString);
  }

  public int b(String paramString)
  {
    return a(c, paramString);
  }

  public int c(String paramString)
  {
    return a(d, paramString);
  }

  public int d(String paramString)
  {
    return a(e, paramString);
  }

  public int e(String paramString)
  {
    return a(g, paramString);
  }

  public int f(String paramString)
  {
    return a(h, paramString);
  }
}